//
//  XYBaseTabbarController.m
//  XY-Video
//
//  Created by WTFKL on 2018/3/15.
//  Copyright © 2018年 WTF. All rights reserved.
//

#import "XYBaseTabbarController.h"
#import "XYBaseNavigationController.h"
#import "MineDefaultViewController.h"
#import "RankDefaultViewController.h"
#import "TypeDefaultViewController.h"
#import "HomeDefaultViewController.h"
@interface XYBaseTabbarController ()

@end

@implementation XYBaseTabbarController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self setUpChildViewController:[[HomeDefaultViewController alloc] init] title:@"首页" imageName:nil selectImageName:nil];
    [self setUpChildViewController:[[TypeDefaultViewController alloc] init] title:@"分类" imageName:nil selectImageName:nil];
    [self setUpChildViewController:[[RankDefaultViewController alloc] init] title:@"排行榜" imageName:nil selectImageName:nil];
    [self setUpChildViewController:[[MineDefaultViewController alloc] init] title:@"我的" imageName:nil selectImageName:nil];
}

-(void)setUpChildViewController:(UIViewController *)vc title:(NSString *)title imageName:(NSString *)imageName selectImageName:(NSString *)selectImageName{
    vc.title = title;
    vc.tabBarItem.image = [UIImage imageNamed:imageName];
    vc.tabBarItem.selectedImage = [UIImage imageNamed:selectImageName];
    vc.tabBarItem.title = nil;
    [vc.tabBarItem setImageInsets:UIEdgeInsetsMake(5, 0, -5, 0)];
    [self addChildViewController:[[XYBaseNavigationController alloc] initWithRootViewController:vc]];
}


@end
